﻿<Pages:AudioBasePage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                     xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
                     xmlns:Pages="clr-namespace:WindowsPhoneAudioStreaming.SampleApplication.Pages"
                     x:Class="WindowsPhoneAudioStreaming.SampleApplication.Pages.PodcastList.PodcastListPage"
                     mc:Ignorable="d"
                     d:DesignHeight="768"
                     d:DesignWidth="480"
                     DataContext="{Binding PodcastList, Source={StaticResource Locator}}"
                     Style="{StaticResource TransitionPageStyle}">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="PodcastListItemTemplate">
            <Grid  Margin="0,0,12,18"
                   >
                <Grid.Background>
                    <SolidColorBrush Color="{StaticResource BrandColour1}" />
                </Grid.Background>
                <Image Source="{Binding ProgramImage}"
                       Height="170"
                       HorizontalAlignment="Left"
                       VerticalAlignment="Top" />
                <Grid VerticalAlignment="Bottom">
                    <Border Opacity="0.5"
                            Margin="0,2,0,0"
                            Background="Black" />
                    <StackPanel Margin="12,0"
                                Orientation="Vertical"
                                d:LayoutOverrides="Height">
                        <TextBlock TextWrapping="Wrap"
                                   Text="{Binding Title, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
                                   Style="{StaticResource PhoneTextExtraLargeStyle}"
                                   Margin="0,0,0,-4"
                                   HorizontalAlignment="Right"
                                   Foreground="#DEFFFFFF" />
                        <TextBlock TextWrapping="Wrap"
                                   Text="{Binding Description}"
                                   Style="{StaticResource PhoneTextTitle3Style}"
                                   Margin="0,0,0,6"
                                   HorizontalAlignment="Right"
                                   TextAlignment="Right"
                                   Foreground="#DEFFFFFF" />
                    </StackPanel>
                </Grid>
            </Grid>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>


    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent"
          d:DataContext="{d:DesignData /SampleData/PodcastListPageSampleData/PodcastListPageSampleData.xaml}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"
                           MinHeight="161" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle"
                        DataContext="{StaticResource StationName}"
					Text="{Binding ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
                       Style="{StaticResource PhoneTextNormalStyle}">
        		<TextBlock.Foreground>
        			<SolidColorBrush Color="{StaticResource BrandColour1}" />
        		</TextBlock.Foreground>
            </TextBlock>
            <TextBlock x:Name="PageTitle"
                       Text="podcasts"
                       Margin="9,-7,0,0"
                       Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>

        <!--TitlePanel contains the name of the application and page title-->

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0,12,0">
            <ListBox x:Name="lbPodcasts"
                     ItemTemplate="{StaticResource PodcastListItemTemplate}"
                     ItemsSource="{Binding Podcasts}"
                     BorderThickness="12,0,0,0"
                     Margin="0,0,0,36" ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}">
            </ListBox>
        </Grid>
    </Grid>

</Pages:AudioBasePage>
